const fs = require('fs')
const path = require('path')
fs.readFile(path.join(__dirname, 'index.html'), (error, data) => {
    if (error) console.log(error)
    else {
        const string = data.toString()
        const resultString = string.replace(/[\r\n]/g, '')
        fs.writeFile(path.join(__dirname, 'zip.html'), resultString, error => {
            if (error) console.log(error)
            else console.log('压缩成功')
        })
    }
})